package cn.tedu.scc.controller;

import cn.tedu.scc.entity.User;
import cn.tedu.scc.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {

    @Autowired
    UserMapper mapper;

    @RequestMapping("/user/select")
    public List<User> select(){
        return mapper.select();
    }

    @RequestMapping("/user/deleteById")
    public void deleteById(int id){
        System.out.println("id = " + id);
        mapper.deleteById(id);
    }
}
